home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
source
/
zendisk2
/
lst13-20.asm
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
804b
|
42 lines
;
; *** Listing 13-20 ***
;
; Zeros the high-bit of each byte in a 100-byte array,
; using in-line code.
;
jmp Skip
;
ARRAY_LENGTH equ 100
ByteArray label byte
db ARRAY_LENGTH dup (80h)
;
; Clears the high bit of each byte in an array of
; length ARRAY_LENGTH.
;
; Input:
; BX = pointer to the start of the array to clear
;
; Output: none
;
; Registers altered: AL, BX
;
ClearHighBits:
mov al,not 80h ;pattern to clear
; high bits with
rept ARRAY_LENGTH ;# of bytes to clear
and [bx],al ;clear the high bit
; of this byte
inc bx ;point to the next
; byte
endm
ret
;
Skip:
call ZTimerOn
mov bx,offset ByteArray
;array in which to clear
; high bits
call ClearHighBits ;clear the high bits of the
; bytes
call ZTimerOff